fix: feed image thumbnails + mobile layout regressions#1332
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (25)
WalkthroughThis PR adds an ChangesDoubled image URL normalization
Mobile-responsive layout and navigation UX
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
HackerNoon's RSS media:thumbnail/media:content URLs are malformed at the source — an already-absolute CDN URL prefixed with their own origin (https://hackernoon.com/https://cdn.hackernoon.com/…), which 404s. Our ingestion stored them verbatim, and the redesigned cards SSR the <img>, so the broken-image icon stuck: the error event fires before React hydrates and attaches onError, so the fallback never runs. - add unwrapDoubledUrl() (utils/url.ts) + unit tests - card: unwrap at render and detect pre-hydration failures via a ref callback, so a dead image collapses to no thumbnail (not a broken icon) - sanitise URLs at ingestion (fetch-rss, admin/sync-feeds — media + OG) - one-off scrub script for already-stored rows Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…reens The relaunch redesign had several mobile regressions: - cards overflowed the viewport (byline meta line couldn't shrink) — now truncates; card padding p-4 on mobile - app-main side gutters reduced to 0.75rem and per-page content wrappers drop px-4 py-8 → px-0 py-4 on mobile (parent already gutters), so text gets full reading width without double padding - top bar collapses to burger + logo + search icon ≤720px; Log in / Join free move into the nav drawer; real search SVG replaces the tiny glyph - feed filters drop to their own row below the tabs instead of cramming under them, and no longer sit in an overflow container that clipped the FilterPill dropdowns (they now open on mobile) - command palette: Esc hint becomes an X close button on mobile - search field active state is a subtle accent underline, not the global (blue-resolving) focus ring Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code review caught that the naive lastIndexOf scan would truncate a URL whose path legitimately contains http://https:// deeper down (path-based image proxies, or a slug literally containing a scheme). Match only an absolute URL sitting immediately after the host — the exact shape of the upstream doubled-origin bug — and leave everything else untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3176a3c to
cd2679d
Compare
Follow-up fixes after the relaunch redesign merge.
1. Broken feed thumbnails (doubled image URLs)
HackerNoon's RSS
media:thumbnail/media:contentURLs are malformed at the source — an already-absolute CDN URL prefixed with their own origin (https://hackernoon.com/https://cdn.hackernoon.com/…), which 404s. Ingestion stored them verbatim, and because the redesigned cards SSR the<img>, the broken-image icon stuck (theerrorevent fires before React hydrates and attachesonError).unwrapDoubledUrl()helper inutils/url.ts(+ unit tests)fetch-rss,admin/sync-feeds— media + OG image)scripts/fix-doubled-image-urls.tsto scrub already-stored rows (display is fixed without it; this cleans data server-side SEO/OG reads)2. Mobile layout regressions
p-4on mobile.app-mainmobile gutter →0.75rem; per-page content wrapperspx-4 py-8→px-0 py-4on mobile (parent already gutters), so text gets full reading widthVerification
utils/url.test.tspasses (6/6); ESLint +tscclean🤖 Generated with Claude Code